package com.leet.everyday;

public class MountainIndex {
    public int peakIndexInMountainArray(int[] arr) {
        int index = 0, ans=Integer.MIN_VALUE;
        for(int i = 0 ; i < arr.length; i++){
            if(arr[i] > ans){
                ans = arr[i];
                index = i;
            }
        }
        return index;
    }
}
